Map

Widget that displays a map for a specific [class@View].

GtkSourceMap is a widget that maps the content of a [class@View] into a smaller view so the user can have a quick overview of the whole document.

This works by connecting a [class@View] to to the GtkSourceMap using the [property@Map:view] property or [method@Map.set_view].

GtkSourceMap is a [class@View] object. This means that you can add a [class@GutterRenderer] to a gutter in the same way you would for a [class@View]. One example might be a [class@GutterRenderer] that shows which lines have changed in the document.

Additionally, it is desirable to match the font of the GtkSourceMap and the [class@View] used for editing. Therefore, [property@Map:font-desc] should be used to set the target font. You will need to adjust this to the desired font size for the map. A 1pt font generally seems to be an appropriate font size. "Monospace 1" is the default. See [method@Pango.FontDescription.set_size] for how to alter the size of an existing [struct@Pango.FontDescription].

When FontConfig is available, GtkSourceMap will try to use a bundled "block" font to make the map more legible.

Constructors

this
this(GtkSourceMap* gtkSourceMap, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new GtkSourceMap.

Members

Functions

getMapStruct
GtkSourceMap* getMapStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getView
View getView()

Gets the [property@Map:view] property, which is the view this widget is mapping.

setView
void setView(View view)

Sets the view that @map will be doing the mapping to.

Static functions

getType
GType getType()

Variables

gtkSourceMap
GtkSourceMap* gtkSourceMap;

the main Gtk struct

Inherited Members

From View

gtkSourceView
GtkSourceView* gtkSourceView;

the main Gtk struct

getViewStruct
GtkSourceView* getViewStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getAutoIndent
bool getAutoIndent()

Returns whether auto-indentation of text is enabled.

getBackgroundPattern
GtkSourceBackgroundPatternType getBackgroundPattern()

Returns the #GtkSourceBackgroundPatternType specifying if and how the background pattern should be displayed for this @view.

getCompletion
Completion getCompletion()

Gets the [class@Completion] associated with @view.

getEnableSnippets
bool getEnableSnippets()

Gets the [property@View:enable-snippets] property.

getGutter
Gutter getGutter(GtkTextWindowType windowType)

Returns the [class@Gutter] object associated with @window_type for @view.

getHighlightCurrentLine
bool getHighlightCurrentLine()

Returns whether the current line is highlighted.

getHover
Hover getHover()

Gets the [class@Hover] associated with @view.

getIndentOnTab
bool getIndentOnTab()

Returns whether when the tab key is pressed the current selection should get indented instead of replaced with the \t character.

getIndentWidth
int getIndentWidth()

Returns the number of spaces to use for each step of indent.

getIndenter
IndenterIF getIndenter()

Gets the [property@View:indenter] property.

getInsertSpacesInsteadOfTabs
bool getInsertSpacesInsteadOfTabs()

Returns whether when inserting a tabulator character it should be replaced by a group of space characters.

getMarkAttributes
MarkAttributes getMarkAttributes(string category, int* priority)

Gets attributes and priority for the @category.

getRightMarginPosition
uint getRightMarginPosition()

Gets the position of the right margin in the given @view.

getShowLineMarks
bool getShowLineMarks()

Returns whether line marks are displayed beside the text.

getShowLineNumbers
bool getShowLineNumbers()

Returns whether line numbers are displayed beside the text.

getShowRightMargin
bool getShowRightMargin()

Returns whether a right margin is displayed.

getSmartBackspace
bool getSmartBackspace()

Returns %TRUE if pressing the Backspace key will try to delete spaces up to the previous tab stop.

getSmartHomeEnd
GtkSourceSmartHomeEndType getSmartHomeEnd()

Returns a [enum@SmartHomeEndType] end value specifying how the cursor will move when HOME and END keys are pressed.

getSpaceDrawer
SpaceDrawer getSpaceDrawer()

Gets the [class@SpaceDrawer] associated with @view.

getTabWidth
uint getTabWidth()

Returns the width of tabulation in characters.

getVisualColumn
uint getVisualColumn(TextIter iter)

Determines the visual column at @iter taking into consideration the [property@View:tab-width] of @view.

indentLines
void indentLines(TextIter start, TextIter end)

Inserts one indentation level at the beginning of the specified lines. The empty lines are not indented.

pushSnippet
void pushSnippet(Snippet snippet, TextIter location)

Inserts a new snippet at @location

setAutoIndent
void setAutoIndent(bool enable)

If %TRUE auto-indentation of text is enabled.

setBackgroundPattern
void setBackgroundPattern(GtkSourceBackgroundPatternType backgroundPattern)

Set if and how the background pattern should be displayed.

setEnableSnippets
void setEnableSnippets(bool enableSnippets)

Sets the [property@View:enable-snippets] property.

setHighlightCurrentLine
void setHighlightCurrentLine(bool highlight)

If @highlight is %TRUE the current line will be highlighted.

setIndentOnTab
void setIndentOnTab(bool enable)

If %TRUE, when the tab key is pressed when several lines are selected, the selected lines are indented of one level instead of being replaced with a \t character. Shift+Tab unindents the selection.

setIndentWidth
void setIndentWidth(int width)

Sets the number of spaces to use for each step of indent when the tab key is pressed.

setIndenter
void setIndenter(IndenterIF indenter)

Sets the indenter for @view to @indenter.

setInsertSpacesInsteadOfTabs
void setInsertSpacesInsteadOfTabs(bool enable)

If %TRUE a tab key pressed is replaced by a group of space characters.

setMarkAttributes
void setMarkAttributes(string category, MarkAttributes attributes, int priority)

Sets attributes and priority for the @category.

setRightMarginPosition
void setRightMarginPosition(uint pos)

Sets the position of the right margin in the given @view.

setShowLineMarks
void setShowLineMarks(bool show)

If %TRUE line marks will be displayed beside the text.

setShowLineNumbers
void setShowLineNumbers(bool show)

If %TRUE line numbers will be displayed beside the text.

setShowRightMargin
void setShowRightMargin(bool show)

If %TRUE a right margin is displayed.

setSmartBackspace
void setSmartBackspace(bool smartBackspace)

When set to %TRUE, pressing the Backspace key will try to delete spaces up to the previous tab stop.

setSmartHomeEnd
void setSmartHomeEnd(GtkSourceSmartHomeEndType smartHomeEnd)

Set the desired movement of the cursor when HOME and END keys are pressed.

setTabWidth
void setTabWidth(uint width)

Sets the width of tabulation in characters.

unindentLines
void unindentLines(TextIter start, TextIter end)

Removes one indentation level at the beginning of the specified lines.

addOnChangeCase
gulong addOnChangeCase(void delegate(GtkSourceChangeCaseType, View) dlg, ConnectFlags connectFlags)

Keybinding signal to change case of the text at the current cursor position.

addOnChangeNumber
gulong addOnChangeNumber(void delegate(int, View) dlg, ConnectFlags connectFlags)

Keybinding signal to edit a number at the current cursor position.

addOnJoinLines
gulong addOnJoinLines(void delegate(View) dlg, ConnectFlags connectFlags)

Keybinding signal to join the lines currently selected.

addOnLineMarkActivated
gulong addOnLineMarkActivated(void delegate(TextIter, uint, GdkModifierType, int, View) dlg, ConnectFlags connectFlags)

Emitted when a line mark has been activated (for instance when there was a button press in the line marks gutter).

addOnMoveLines
gulong addOnMoveLines(void delegate(bool, View) dlg, ConnectFlags connectFlags)

The signal is a keybinding which gets emitted when the user initiates moving a line.

addOnMoveToMatchingBracket
gulong addOnMoveToMatchingBracket(void delegate(bool, View) dlg, ConnectFlags connectFlags)

Keybinding signal to move the cursor to the matching bracket.

addOnMoveWords
gulong addOnMoveWords(void delegate(int, View) dlg, ConnectFlags connectFlags)

The signal is a keybinding which gets emitted when the user initiates moving a word.

addOnPushSnippet
gulong addOnPushSnippet(void delegate(Snippet, TextIter, View) dlg, ConnectFlags connectFlags)

The signal is emitted to insert a new snippet into the view.

addOnShowCompletion
gulong addOnShowCompletion(void delegate(View) dlg, ConnectFlags connectFlags)

The signal is a key binding signal which gets emitted when the user requests a completion, by pressing <keycombo><keycap>Control</keycap><keycap>space</keycap></keycombo>.

addOnSmartHomeEnd
gulong addOnSmartHomeEnd(void delegate(TextIter, int, View) dlg, ConnectFlags connectFlags)

Emitted when a the cursor was moved according to the smart home end setting.

Meta